package hu.diploma.web.server.restlet.resources;

import hu.diploma.common.resource.EmailResource;
import hu.diploma.common.service.EmailService;
import hu.diploma.common.vos.EmailVo;
import hu.diploma.core.util.ServiceProviderImpl;

import java.util.ArrayList;

import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;

public class EmailResourceImpl extends ServerResource implements EmailResource {
	EmailService emailService = ServiceProviderImpl.getServiceProvider().getEmailService();

	@Post
	public void merge(ArrayList<EmailVo> emailVos) {
		for (EmailVo emailVo : emailVos) {
			try {
				emailService.save(emailVo);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}

}
